
namespace AutomaticLogin
{
    using System;
    using System.Xml.Serialization;
    using System.Xml;
    using System.Text;


    public class LoginInfo
    {
        private const string OPEN_TAG = @"<LoginInfo key=""{0}"" >";
        private const string CLOSE_TAG = @"</LoginInfo>";

        protected LoginInputs m_LoginInputs;

        protected String m_key;
                
        public LoginInfo()
        {}

        public LoginInfo(XmlNode node)
        {
            m_key = node.Attributes["key"].Value;
            m_LoginInputs = new LoginInputs(node);
        }

        public LoginInputs LoginInputs
        {
            get
            {
                return m_LoginInputs;
            }
            set
            {
                m_LoginInputs = value;
            }
        }

        public String key
        {
            get
            {
                return m_key;
            }
            set
            {
                m_key = value;
            }
        }

        public string ToXml()
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine(string.Format(OPEN_TAG, m_key));
            sb.AppendLine(m_LoginInputs.ToXml());
            sb.AppendLine(CLOSE_TAG);
            return sb.ToString();
        }
    }
}
